<?php

include ('top.ajax.php');

	$id=$_POST['id'];
	$db = Database::getInstance();
	$sql="DELETE FROM produits WHERE id='".$id."'";
	$db->query($sql);
	$product=new Product($id);
		foreach ($product->getPhotos() as $photo){
			$photo->delete();
					}
					
		foreach ($product->getComplement() as $compl){
						$compl->delete();
					}
		foreach ($product->getLabels() as $label){
						$label->delete($id);
					}
								
					
					
	

	
	 

?>